method of least square for straight line and parabola